package test1224;

public class Test07 {
    public static void main(String[] args) {
        // 求出arr中元素的平均值
        int[] arr = {6, 1, 7, 4, 3};
        int sum = 0;
        double avg = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
            avg = (double) sum / (double) arr.length;
        }
        System.out.println(avg);
    }
}
